home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Diamond Collection
/
The Diamond Collection (Software Vault)(Digital Impact).ISO
/
cdr12
/
ncal10.zip
/
NCAL.DOC
< prev
next >
Wrap
Text File
|
1995-03-23
|
6KB
|
138 lines
NCAL Version 1.0, written by Christopher M. Sokol.
Copyright (c) 1995 Christopher M. Sokol.
All Rights Reserved.
NCAL is a calendar program similar to the UNIX cal command. It is more
powerful than cal in a number of ways, and I left out the "display the entire
year" option.
While browsing a local board, I came across a cal implementation which added
a bunch of functionality. I had been looking for a way to stop missing
birthdays, so I grabbed it. This program was pretty good, but I didn't like
a number of things about it. Source code was included, but upon brief
examination, I decided that it was too ugly to touch. So I sat down and wrote
the program that I really wanted. This is it.
NCAL will display events which can be assigned in a fairly flexible manner.
The calendar is displayed in color by default, and ANSI.SYS is not required.
Color display is compatible with NNANSI.SYS, or other text mode accelerators
which change the location of video memory when scrolling. ANSI.SYS output
is supported.
I really wrote this program for the fun of it. If you encounter any bugs,
or you think a particular feature would be cool, or you have some good reason
why I should give you the source code, send email to chris@infosafe.com.
Usage:
NCAL [options] [month [year]]
The following options are available:
-a Causes NCAL to control display attributes with ANSI sequences,
rather than writing directly to video memory.
-f Only displays events occuring today or in the future, events
which occured prior to today are not displayed.
-iFILE Causes FILE to be read. The files which NCAL reads define
events and colors.
-t Causes NCAL to output only text; display attributes are not
used. This switch is turned on if NCAL's output is redirected
or piped. Specifying -a, however, will cause display
attributes to be used, and output as ANSI sequences.
month can be specified as a number, a three letter month abbreviation, or
the full month name.
The argument @filename in the command line will expand to the contents of the
named file.
The files which NCAL reads are divided into three sections: [events], [colors],
and [monocolors]. In addition, a section independant include directive is
defined.
Comments can be placed anywhere (except in quoted strings) by preceding them
with a semi-colon.
The directive
include file_name
will cause file_name to be added to the list of files which NCAL will read.
The [events] section defines text to be printed, and when it should be
printed. When NCAL is run, it will display all events which affect the
displayed month, and the month after that. Each event in the section defines
a filter which control whether or not the event should occur.
Each event takes one line, with 6 fields. These fields are as follows:
MONTH DATE YEAR WEEK DAY TEXT
The first 5 fields are integers, and the last one is a quoted string. NCAL
loads the entire event list, and then for tests each day in the printable
range against each event. The filtering process happens like this:
The YEAR field is examined. If it is -1, this comparison completes
successfully. Otherwise, if the YEAR field value is not equal to the
year being tested, the event is discarded.
The MONTH field is examined. This comparison is the same as the YEAR
comparison: if it is not -1, and it is not equal to the month being tested,
the event is discarded.
If the DATE field is -1, then testing continues with WEEK and DAY, as
described below. Otherwise, if the date being tested is equal to the DATE
field, the event occurs on the tested date.
The WEEK and DAY fields are used together. These fields are only tested
when the DATE field is -1. The DAY field specifies a day of the week, with
1 to 7 corresponding to Sunday to Saturday. The WEEK field specified which
day of the month. For example, WEEK = 2 and DAY = 4 would specify an event
which would occur on the second Wednesday of the month. -1 is a wild value
with both of these fields: WEEK = -1 and DAY = 2 means every Monday, whereas
WEEK = 3 and DAY = -1 would refer to the range of dates from the 15th to the
21st. WEEK = -1 and DAY = -1 defines a daily event, which produces too much
data to be useful.
When the TEXT field of the event is printed, it is examined for the construct
{YEAR}, where YEAR is an integer. If this is found, it will be replaced with
the number (DISPLAYED_YEAR - YEAR), with the appropriate numerical suffix
added. Thus, {1969} would display as "26th" in the year 1995.
The [colors] section defines color mode display attributes. Each line in
this section should have the form:
color_name = color_description
color_name vlues:
dates This is the color of the numbers on the calendar (except for
today)
dosbkgnd This is the normal DOS background color. This is only used
in ANSI mode before printing line feeds and before NCAL exits.
evothermonth This is the color of the event list for months other than the
current one.
evthismonth This is the color of the event list for events which are
occuring this month.
evtoday This is the color of events which are occuring today.
evtodaystar This is the color of the '***' which marks events occuring
today.
header This is the color of the " Su Mo Tu We Th Fr Sa " at the top
of the calendar display.
monthname This is the color of the month and year line at the top of the
calendar display.
today This is the color of the date in the calendar display for
today.
color_description is an english description of the color to use. It has the
following form:
BRIGHT BLINKING WHITE ON BLUE
Bright and blinking are optional attributes. The following colors are
available: black, blue, green, cyan, red, magenta, yellow, and white.
The [monocolors] section defines monochrome mode display attributes. The
content of this section is identical to the content of the [colors] section.
Due to my lack of interest in monochrome display adapters, I did not bother
to define monochrome color strings. Use blue for underlined text, or use
white for normal text. Bright and blinking are still valid attributes.
Case is not significant anywhere except the text to be printed.
-------------------------------------------------------------------------------
NCAL is freeware.